import java.util.Scanner;

/**
 * @Author @fiber-cloud
 * @Date 2025/6/28 20:14
 */

class A{
    public String toString(){
        return "111";
    }
}
public class Test {
    public static void main(String[] args) {
//        A a = new A();
//        System.out.println(new A());
//        System.out.println(a);
//
//        Scanner sc = new Scanner(System.in);
//        while (sc.hasNext()){
////            int x = sc.nextInt();
////            int y = sc.nextInt();
////            Data data = new Data(x, y);
////            System.out.println(data.getX()+data.getY());
//            int age = sc.nextInt();
//            Age age1 = new Age(age);
//            System.out.println(age1.getAge());
//        }

        outerClass o = new outerClass();
        outerClass.InnerClass innerClass = new outerClass.InnerClass();
        o.test();
        innerClass.test2();
    }

}

//意味着这些东西只能在当前类中使用
class Data{
    private int x;//封装的
    private int y;
    public Data(int x, int y){
        this.x = x;
        this.y = y;
    }
    public int getX(){
        return x;
    }
    public int getY(){
        return y;
    }
}


class Age{
    public int age;
    public Age(int age){
        this.age = age;
    }
    public int getAge(){
        if (age > 200){
            return 200;
        } else if (age < 0) {
            return 0;
        }else {
            return age;
        }
    }
}

class outerClass{
    public int data1;
    int data2;
    public static int data3;

    public void test(){
        System.out.println("outerClass::test");
    }
    /**
     * 实例内部类
     * 如何获取实例内部类对象
     * 实例内部类中不能有static修饰的成员
     */

    static class InnerClass{
        public int data4;
        int data5;
        public static final int data6 = 10;//加上final后，会变成一个常量，而常量在编译时会执行
        public void test2(){
            System.out.println("InnerClass::test2");
        }
    }
}
